package com.crazy.mybatis.gerenator.service.xml;

import com.crazy.mybatis.gerenator.service.common.Constants;

public abstract class AbstractElementBuilder {

	protected String id;
	
	protected String elementName;
	
	AbstractElementBuilder(String id, String elementName) {
		this.id = id;
		this.elementName = elementName;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getElementName() {
		return elementName;
	}

	public void setElementName(String elementName) {
		this.elementName = elementName;
	}
	
	protected String intent(int level) {
		StringBuilder result = new StringBuilder(Constants.LINE_END);
		while (level > 0) {
			result = result.append(Constants.INTENT);
			level--;
		}
		return result.toString();
	}
	
}
